package com.serwis.app.common;

import javax.naming.NamingException;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.AnnotationConfiguration;

import com.serwis.app.entities.Status;

public class Testowa{
	public static void main(String []a) throws NamingException{
		
		AnnotationConfiguration cfg = new AnnotationConfiguration();
		//Configuration cfg = new Configuration();
		cfg.configure("hibernate.cfg.xml").buildSessionFactory() ;
		SessionFactory factory=cfg.buildSessionFactory(); 
		
		Session session=factory.openSession(); 
		Transaction t=session.beginTransaction(); 
		
		Status stat = new Status("A", "Anulowane");
		session.save(stat);

		
		t.commit();
		session.close(); 

	}
}

	
	
	
	
